<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app">
      <!-- v-show和v-if一样都是来控制元素的显示和隐藏的 -->
      <!-- 
        v-if是直接渲染或者不渲染
        v-show是通过css的display来显示或者隐藏
      -->
      <!-- 
        v-show具有更低的切换开销，频繁切换
        v-if具有更低的初始开销，不需要频繁切换并且初始不显示的
      -->
      <h2>v-show指令</h2>
      <p v-show="show">Vue is awesome!</p>
    </div>

    <script src="./lib/vue3.js"></script>
    <script>
      const { createApp } = Vue;

      createApp({
        data() {
          return {
            show: false,
          };
        },
      }).mount("#app");
    </script>
  </body>
</html>
